const PROTOCOL = 'http'
const HOST = '192.168.35.11'
const PORT = '3005'
const baseURL = `${PROTOCOL}://${HOST}:${PORT}`
import axios from "axios"
import './store'
import './goods'
import './order'
// 向后端传递id，返回该用户的所有购物车产品
export const mycartFunc=(url,data={})=>{
    return axios({
        method: 'get',
        url: `${baseURL}${url}`,
        params: {
         ...data
        }
    }).then((response)=>{
    }).catch(data=>{
        console.log(data);
    })
   
}
// 按用户id查询购物车
export const querygoodsFunc=(url,data={},option = {headers: "application/x-www-form-urlencoded"})=>{
        return axios({
            method:'get',
            url:`${baseURL}${url}`,
            params:{
                ...data
            }
            
        }).then((response)=>{
            console.log('获取成功');
            console.log(response);
            return response.data
            
        })
}
//货物查询
export const goodssearchFunc=(url,data={})=>{
    return axios({
        method:'get',
        url:`${baseURL}${url}`,
        params:{
            ...data
        }
    }).then((response)=>{
        console.log('货物搜索获取成功');
        console.log(response);
        return response.data
        
    })
}
//登录功能
